//
//  AutherEmterpriseTableViewCell.m
//  GLGW_Shoping
//
//  Created by yang on 2018/12/6.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "AutherEmterpriseTableViewCell.h"

@implementation AutherEmterpriseTableViewCell{
    GLGWTextField * inputTextField;
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        inputTextField = [[GLGWTextField alloc] initTitlePlaceholder:@"请输入营业执照注册号" theFont:SYSTEMFONT(14) theTitColor:kColor_Rule_Black inSuperView:self.contentView];
        inputTextField.clearButtonMode=UITextFieldViewModeWhileEditing;
        inputTextField.delegate = nil;
        [inputTextField addTarget:self action:@selector(textField1TextChange:) forControlEvents:UIControlEventEditingChanged];
        [inputTextField mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView.mas_left).offset(kWidthProportion_In_iPhoneTriploid(15));
            make.right.equalTo(self.contentView.mas_right).offset(-kWidthProportion_In_iPhoneTriploid(15));
            make.top.bottom.equalTo(self.contentView);
        }];
    }
    return self;
}

-(void)setPlaceholderStr:(NSString *)placeholderStr{
    _placeholderStr = placeholderStr;
    inputTextField.placeholder = _placeholderStr;
}


-(void)setMarkModel:(AdressMarkModel *)markModel{
    _markModel = markModel;
}

-(void)setIndexPath:(NSIndexPath *)indexPath{
    _indexPath = indexPath;
}

-(void)textField1TextChange:(GLGWTextField *)textField{
    switch (_indexPath.section) {
        case 0:{
            if (_indexPath.row == 0) {
                _markModel.lineOneStr = textField.text;
            }else if (_indexPath.row == 1){
                _markModel.lineTwoStr = textField.text;
            }else{
                _markModel.lineThreeStr = textField.text;
            }
        }
            break;
        case 1:{
            if (_indexPath.row == 0) {
                _markModel.lineFourStr = textField.text;
            }else{
                _markModel.lineFiveStr = textField.text;
            }
        }
            break;
            
        default:
            break;
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
